﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<TemplateWeb.Models.ViewModels.GroupViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <%
        var lstDoLuuNiem = Model.DoLuuNiemModel.GetModel.LstObjModel.ToList();
        var numRow = lstDoLuuNiem.Count % 4 == 0 ? lstDoLuuNiem.Count / 4 : (lstDoLuuNiem.Count / 4 + 1);
    %>
    <div class="cate_area">
        <div class="bg_nav">
            <a href="<%= Url.Action("Index", "Home") %>">Trang chủ</a> » Đồ lưu niệm
        </div>
        <div class="bg_760">
            <h4>Đồ lưu niệm</h4>
        </div>
        <div class="clear">
        </div>
        <div class="bg_760_center" style="padding: 10px; width: 738px">
            <% var ItemIndex = 0;
               for (int i = 0; i < numRow; i++)
               { %>
            <div class="product_list">
                <% for (int j = ItemIndex; j < lstDoLuuNiem.Count; j++)
                   { %>
                <div class="prod_item">
                    <center>
                        <a href="<%= Url.Action("ChiTietDoLuuNiem", "Home", new { id = lstDoLuuNiem[j].ID }) %>">
                            <img src="../../Content/Images/Items/<%= lstDoLuuNiem[j].SanPham.HinhMinhHoa %>"
                                alt="<%= lstDoLuuNiem[j].SanPham.TenSanPham %>" width="120" height="160"></a>
                        <p class="prod_name">
                            <a href="<%= Url.Action("ChiTietDoLuuNiem", "Home", new { id = lstDoLuuNiem[j].ID }) %>">
                                <%= lstDoLuuNiem[j].SanPham.TenSanPham%></a></p>
                        <p class="font_price">
                            Giá bán:
                            <%= string.Format("{0:0,0}", lstDoLuuNiem[j].SanPham.GiaBan)%>
                            ₫</p>
                    </center>
                </div>
                <% ItemIndex++;
                   if (ItemIndex > 0 && ItemIndex % 4 == 0)
                   {
                       break;
                   }
                   } %>
            </div>
            <% } %>
        </div>
        <div class="clear">
        </div>
        <div class="bg_760_bt">
        </div>
    </div>
</asp:Content>
